<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<input type="checkbox" name="hobby" class="hobby" value="" />1 <br>
		<input type="checkbox" name="hobby" class="hobby" value="" />2 <br>
		<input type="checkbox" name="hobby" class="hobby" value="" />3
		<button type="button" id="t">true</button>
		<button type="button" id="f">false</button>
	</body>
	<script type="text/javascript">
		$("#t").click(function(){
			// $(".hobby").attr("checked",true)
			$(".hobby").prop("checked",true)
			// $("[class=hobby]").attr("checked",true)
		})
		$("#f").click(function(){
			$(".hobby").prop("checked",false)
		})
	</script>
</html>
